package generic;


import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

public class GenericTest<T extends Number ,E extends String> {

    private T age;
    private E name;

    public static void main(String[] args) {

        GenericTest<Integer,String> genericTest = new GenericTest<>();
        //通过反射技术获取字节码class对象
        Class<? extends GenericTest> aClass = genericTest.getClass();

        //获取全部成员变量
        Field[] declaredFields = aClass.getDeclaredFields();
        for (Field field : declaredFields) {
            //获取每个属性的名称和类型
            System.out.println(field.getName()+",类型="+field.getType().getSimpleName());
        }
    }
}
